home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / dev / scsi.man < prev    next >
Encoding:
Text File  |  1989-07-10  |  2.8 KB  |  73 lines

  1. '\" Copyright 1989 Regents of the University of California
  2. '\" Permission to use, copy, modify, and distribute this
  3. '\" documentation for any purpose and without fee is hereby
  4. '\" granted, provided that this notice appears in all copies.
  5. '\" The University of California makes no representations about
  6. '\" the suitability of this material for any purpose.  It is
  7. '\" provided "as is" without express or implied warranty.
  8. '\" 
  9. '\" $Header: /sprite/src/man/dev/RCS/mouse.man,v 1.2 89/06/25 17:11:24 ouster Exp $ SPRITE (Berkeley)
  10. '/" 
  11. .so \*(]ltmac.sprite
  12. .HS SCSI dev
  13. .BS
  14. '\" Note:  do not modify the .SH NAME line immediately below!
  15. .SH NAME
  16. scsi \- Devices used to send arbitrary SCSI commands to SCSI devices
  17. .SH SYNOPSIS
  18. \fB#include <dev/scsi.h>\fR
  19. .BE
  20.  
  21. .SH DESCRIPTION
  22. .PP
  23. SCSI devices are used to send arbitrary SCSI commands to SCSI devices.
  24. The interface uses IO-Controls to pass the SCSI command block and 
  25. command data to the device and return the command status byte,
  26. command data, and any scsi mode sense data generated.
  27. The IO-Control \fBIOC_SCSI_COMMAND\fR takes as input a Dev_ScsiCommand
  28. and returns in the out buffer a Dev_ScsiStatus.
  29. .DS
  30. \fCtypedef struct Dev_ScsiCommand {
  31.     int        bufferLen;
  32.     int        dataOffset;
  33.     int        commandLen;    
  34. } Dev_ScsiCommand;\fR
  35. .DE
  36. The field \fBbufferLen\fR specifies the length of the command's data
  37. buffer. 
  38. The data buffer itself is located in the in buffer for commands that
  39. send data to the device and the out buffer for commands that return
  40. data. \fBdataOffset\fR specifies the offset into the IO-Control's 
  41. input buffer of the start of the data buffer.  If \fBbufferLen\fR is 
  42. greater than zero and the \fBdataOffset\fR equals the size of the
  43. input buffer then the command is assumed to return data.
  44. The \fBcommandLen\fR field specifies the number of bytes following 
  45. the Dev_ScsiCommand structure that make up the SCSI command block. 
  46. .DS
  47. \fCtypedef struct Dev_ScsiStatus {
  48.     int        statusByte;
  49.     int        amountTransferred;
  50.     int        senseDataLen;    
  51. } Dev_ScsiStatus;\fR
  52. .DE
  53. The output buffer of the \fBIOC_SCSI_COMMAND\fR command consists of a
  54. Dev_ScsiStatus followed by any data returned by the device followed by
  55. any sense data generated by the command. 
  56. The field \fBstatusByte\fR contains the SCSI status byte as returned
  57. by the SCSI device and the field \fBamountTransferred\fR reports the 
  58. number of data bytes transferred by the command. \fBsenseDataLen\fR
  59. reports the number of bytes of sense data returned byte the command.
  60. The out buffer looks like:
  61. .DS
  62.     Dev_ScsiStatus    statusBlock;
  63.     char data[statuBlock.amountTransferred];
  64.     char modeSenseData[statuBlock.senseDataLen];
  65. .DE
  66. .SH WARNING
  67. .PP
  68. The SCSI command set supported by most devices include some very 
  69. destructive commands such as FORMAT_UNIT and ERASE_TAPE. 
  70. Extreme care should be taken when using this interface.
  71. .SH KEYWORDS
  72. scsi command, scsi device, HBA
  73.